/**
 * @file test.cpp
 * @brief main for suffix tree test
 * @author babear.wangz
 * @date 2011-04-12
 */

#include "ZSuffixTreeWrapper.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <sys/time.h>
#include <fstream>
#include <string>
#include <iostream>
using namespace std;

int main()
{

    ZSuffixTreeASCII st("aabbaabbbo", 10);
    st.Construct();
    st.ReConstruct("ababc", 5);
    const char s[] = "王震王震a";
    ZSuffixTreeUTF8 stutf8(s, sizeof(s));
    stutf8.Construct();

/*
    FILE* fp = fopen("standard_couplet", "rb");
    fseek(fp, 0, SEEK_END);
    long size = ftell(fp);
    rewind(fp);
    char* buffer = (char*)malloc(sizeof(char)*size);
    ASSERT(buffer);
    long result = fread(buffer, 1, size, fp);
    if (result != size) {
        printf("reading error!\n");
    }
    //ZSuffixTreeASCII st(buffer, size);
    ZSuffixTreeUTF8 st(buffer, size);
    free(buffer);
    struct timeval tv1, tv2;
    gettimeofday(&tv1,0);
    st.Construct();
    gettimeofday(&tv2,0);
    printf("time: %ld", tv2.tv_sec - tv1.tv_sec);
*/
/*
    ZSuffixTreeString st;
    vector<string> v;
    v.push_back("Jack");
    v.push_back("Jeo");
    v.push_back("Jack");
    v.push_back("Jeo");
    v.push_back("Jolin");
    st.PushBack(&v[0], 1);
    st.PushBack(&v[1], 1);
    st.PushBack(&v[2], 1);
    st.PushBack(&v[3], 1);
    st.PushBack(&v[4], 1);
*/
    return 0;
}

